import com.google.protobuf.Internal;
import org.apache.hadoop.hdfs.util.EnumCounters;
import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;

import java.io.IOException;
import java.time.temporal.Temporal;

public class WordCountMapper extends Mapper<LongWritable, Text, IntWritable,IntWritable> {
    private IntWritable tmp =new IntWritable();

    @Override
    protected void map(LongWritable key, Text value, Context context) throws IOException, InterruptedException {
        String s = value.toString();
        tmp.set(Integer.parseInt(s));
        context.write(tmp,new IntWritable(1));
    }
}
